package com.kaishengit.web;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.kaishengit.pojo.GoodsBack;
import com.kaishengit.service.GoodsBackService;

@Controller
public class GoodsBackController {
	private GoodsBackService goodsBackService;
	
	@RequestMapping("/goodsBackList")
	public String findAll(Model model){
		List<GoodsBack> goodsBackList = goodsBackService.findAll();
		model.addAttribute("goodsBackList", goodsBackList);
		return "goodsBackList";
	}
	@RequestMapping("goodsBacklist")
	public String findByWhere(Model model ,GoodsBack goodsBack){
		List<GoodsBack> goodsBackList = goodsBackService.findByWhere(goodsBack);
		model.addAttribute("goodsBackList", goodsBackList);
		return "goodsBackList";
	}
	
	@RequestMapping("addGoodsBack")
	public String addGoodsBack(GoodsBack goodsBack){
		goodsBackService.add(goodsBack);
		return "redirect:/goodsBack";
	}


	@Autowired
	public void setGoodsBackService(GoodsBackService goodsBackService) {
		this.goodsBackService = goodsBackService;
	}
	
	
	

}
